package com.shine.app.bean;

import com.google.gson.annotations.SerializedName;
import com.shine.app.commons.StringUtils;

public class GolfCourseBean extends BaseBean {

	private static final long serialVersionUID = 1L;
	@SerializedName("Id")
	private int id;
	@SerializedName("Name")
	private String name;
	@SerializedName("Homepage")
	private String homepage;
	@SerializedName("Address1")
	private String address1;
	@SerializedName("City")
	private String city;
	@SerializedName("ZipCode")
	private String zipCode;
	@SerializedName("StateCode")
	private String stateCode;
	@SerializedName("Image")
	private String image;
	@SerializedName("Description")
	private String description;
	@SerializedName("ReviewAverage")
	private double reviewAverage;
	@SerializedName("Latitude")
	private double latitude;
	@SerializedName("Longitude")
	private double longitude;
	@SerializedName("NumberOfHoles")
	private double numberOfHoles;
	@SerializedName("NumberOfReservationLast7Days")
	private double numberOfReservationLast7Days;
	@SerializedName("AverageRoundTime")
	private double averageRoundTime;
	@SerializedName("IsFavorite")
	private boolean isFavorite;
	@SerializedName("Distance")
	private double distance;
	@SerializedName("CancellationWindowInHours")
	private int cancellationWindowInHours;

	@SerializedName("TeeTimes")
	private GolfTeeTimeBean[] teeTimes;
	@SerializedName("FirstTeeTime")
	private String firstTeeTime;
	@SerializedName("LastTeeTime")
	private String lastTeeTime;
	@SerializedName("LowestTeeTimeRate")
	private RateBean lowestTeeTimeRate;
	@SerializedName("HighestTeeTimeRate")
	private RateBean highestTeeTimeRate;
	@SerializedName("TotalNumberOfTeeTimes")
	private int totalNumberOfTeeTimes;
	@SerializedName("TotalNumberOfPrepayTeeTimes")
	private int totalNumberOfPrepayTeeTimes;
	@SerializedName("TotalNumberOfSpecialTeeTimes")
	private int totalNumberOfSpecialTeeTimes;
	@SerializedName("Currency")
	private String currency;
	@SerializedName("AlwaysRequireCreditCard")
	private boolean alwaysRequireCreditCard;

	public int getId() {
		return id;
	}

	public String getCurrency() {
		return currency;
	}

	public boolean isAlwaysRequireCreditCard() {
		return alwaysRequireCreditCard;
	}

	public void setAlwaysRequireCreditCard(boolean alwaysRequireCreditCard) {
		this.alwaysRequireCreditCard = alwaysRequireCreditCard;
	}

	public void setCurrency(String currency) {
		this.currency = currency;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getHomepage() {
		if (StringUtils.isEmpty(homepage)) {
			homepage = " ";
		}
		return homepage;
	}

	public void setHomepage(String homepage) {
		this.homepage = homepage;
	}

	public String getAddress1() {
		if (StringUtils.isEmpty(address1)) {
			address1 = " ";
		}
		return address1;
	}

	public void setAddress1(String address1) {
		this.address1 = address1;
	}

	public String getCity() {
		if (StringUtils.isEmpty(city)) {
			city = " ";
		}
		return city;
	}

	public void setCity(String city) {
		this.city = city;
	}

	public String getZipCode() {
		if (StringUtils.isEmpty(zipCode)) {
			zipCode = " ";
		}
		return zipCode;
	}

	public void setZipCode(String zipCode) {
		this.zipCode = zipCode;
	}

	public String getStateCode() {
		if (StringUtils.isEmpty(stateCode)) {
			stateCode = " ";
		}
		return stateCode;
	}

	public void setStateCode(String stateCode) {
		this.stateCode = stateCode;
	}

	public String getImage() {
		return image;
	}

	public void setImage(String image) {
		this.image = image;
	}

	public String getDescription() {
		return description;
	}

	public void setCancellationWindowInHours(int cancellationWindowInHours) {
		this.cancellationWindowInHours = cancellationWindowInHours;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public double getReviewAverage() {
		return reviewAverage;
	}

	public Integer getCancellationWindowInHours() {
		return cancellationWindowInHours;
	}

	public void setCancellationWindowInHours(Integer cancellationWindowInHours) {
		this.cancellationWindowInHours = cancellationWindowInHours;
	}

	public int getTotalNumberOfSpecialTeeTimes() {
		return totalNumberOfSpecialTeeTimes;
	}

	public void setTotalNumberOfSpecialTeeTimes(int totalNumberOfSpecialTeeTimes) {
		this.totalNumberOfSpecialTeeTimes = totalNumberOfSpecialTeeTimes;
	}

	public void setReviewAverage(double reviewAverage) {
		this.reviewAverage = reviewAverage;
	}

	public double getLatitude() {
		return latitude;
	}

	public void setLatitude(double latitude) {
		this.latitude = latitude;
	}

	public double getLongitude() {
		return longitude;
	}

	public void setLongitude(double longitude) {
		this.longitude = longitude;
	}

	public double getAverageRoundTime() {
		return averageRoundTime;
	}

	public void setAverageRoundTime(double averageRoundTime) {
		this.averageRoundTime = averageRoundTime;
	}

	public boolean isFavorite() {
		return isFavorite;
	}

	public void setFavorite(boolean isFavorite) {
		this.isFavorite = isFavorite;
	}

	public double getDistance() {
		return distance;
	}

	public void setDistance(double distance) {
		this.distance = distance;
	}

	public GolfTeeTimeBean[] getTeeTimes() {
		return teeTimes;
	}

	public void setTeeTimes(GolfTeeTimeBean[] teeTimes) {
		this.teeTimes = teeTimes;
	}

	public String getFirstTeeTime() {
		return firstTeeTime;
	}

	public void setFirstTeeTime(String firstTeeTime) {
		this.firstTeeTime = firstTeeTime;
	}

	public String getLastTeeTime() {
		return lastTeeTime;
	}

	public void setLastTeeTime(String lastTeeTime) {
		this.lastTeeTime = lastTeeTime;
	}

	public double getNumberOfHoles() {
		return numberOfHoles;
	}

	public void setNumberOfHoles(double numberOfHoles) {
		this.numberOfHoles = numberOfHoles;
	}

	public double getNumberOfReservationLast7Days() {
		return numberOfReservationLast7Days;
	}

	public void setNumberOfReservationLast7Days(
			double numberOfReservationLast7Days) {
		this.numberOfReservationLast7Days = numberOfReservationLast7Days;
	}

	public RateBean getLowestTeeTimeRate() {
		return lowestTeeTimeRate;
	}

	public void setLowestTeeTimeRate(RateBean lowestTeeTimeRate) {
		this.lowestTeeTimeRate = lowestTeeTimeRate;
	}

	public RateBean getHighestTeeTimeRate() {
		return highestTeeTimeRate;
	}

	public void setHighestTeeTimeRate(RateBean highestTeeTimeRate) {
		this.highestTeeTimeRate = highestTeeTimeRate;
	}

	public int getTotalNumberOfTeeTimes() {
		return totalNumberOfTeeTimes;
	}

	public void setTotalNumberOfTeeTimes(int totalNumberOfTeeTimes) {
		this.totalNumberOfTeeTimes = totalNumberOfTeeTimes;
	}

	public int getTotalNumberOfPrepayTeeTimes() {
		return totalNumberOfPrepayTeeTimes;
	}

	public void setTotalNumberOfPrepayTeeTimes(int totalNumberOfPrepayTeeTimes) {
		this.totalNumberOfPrepayTeeTimes = totalNumberOfPrepayTeeTimes;
	}

	public static String getCityAddress(final GolfCourseBean golfCourseBean) {
		StringBuilder builder = new StringBuilder();
		String city = golfCourseBean.getCity().trim();
		if (StringUtils.isEmpty(city)) {
			builder.append(city + " ");
		} else {
			builder.append(city + ", ");
		}
		builder.append(golfCourseBean.getStateCode() + " "
				+ golfCourseBean.getZipCode());
		return builder.toString().trim();
	}
}
